package com.ruoyi.material.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.material.mapper.MaterialReturnRequestMapper;
import com.ruoyi.material.domain.MaterialReturnRequest;
import com.ruoyi.material.service.IMaterialReturnRequestService;
import com.ruoyi.common.core.text.Convert;

/**
 * 焊材退库管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-11
 */
@Service
public class MaterialReturnRequestServiceImpl implements IMaterialReturnRequestService 
{
    @Autowired
    private MaterialReturnRequestMapper materialReturnRequestMapper;

    /**
     * 查询焊材退库管理
     * 
     * @param id 焊材退库管理主键
     * @return 焊材退库管理
     */
    @Override
    public MaterialReturnRequest selectMaterialReturnRequestById(Long id)
    {
        return materialReturnRequestMapper.selectMaterialReturnRequestById(id);
    }

    /**
     * 查询焊材退库管理列表
     * 
     * @param materialReturnRequest 焊材退库管理
     * @return 焊材退库管理
     */
    @Override
    public List<MaterialReturnRequest> selectMaterialReturnRequestList(MaterialReturnRequest materialReturnRequest)
    {
        return materialReturnRequestMapper.selectMaterialReturnRequestList(materialReturnRequest);
    }

    /**
     * 新增焊材退库管理
     * 
     * @param materialReturnRequest 焊材退库管理
     * @return 结果
     */
    @Override
    public int insertMaterialReturnRequest(MaterialReturnRequest materialReturnRequest)
    {
        materialReturnRequest.setCreateTime(DateUtils.getNowDate());
        return materialReturnRequestMapper.insertMaterialReturnRequest(materialReturnRequest);
    }

    /**
     * 修改焊材退库管理
     * 
     * @param materialReturnRequest 焊材退库管理
     * @return 结果
     */
    @Override
    public int updateMaterialReturnRequest(MaterialReturnRequest materialReturnRequest)
    {
        materialReturnRequest.setUpdateTime(DateUtils.getNowDate());
        return materialReturnRequestMapper.updateMaterialReturnRequest(materialReturnRequest);
    }

    /**
     * 批量删除焊材退库管理
     * 
     * @param ids 需要删除的焊材退库管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialReturnRequestByIds(String ids)
    {
        return materialReturnRequestMapper.deleteMaterialReturnRequestByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除焊材退库管理信息
     * 
     * @param id 焊材退库管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialReturnRequestById(Long id)
    {
        return materialReturnRequestMapper.deleteMaterialReturnRequestById(id);
    }
}
